/*
 * This file is part of the Sx Framework Library.
 * 
 * Copyright (C) 2013 University of Colorado Denver
 * <min.choi@ucdenver.edu> <shane.transue@ucdenver.edu>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy 
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 * copies of the Software, and to permit persons to whom the Software is 
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in 
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 * DEALINGS IN THE SOFTWARE.
 */
#ifndef SX_OBJ_MESH_H
#define SX_OBJ_MESH_H

#include <sxString.h>
#include <sxOBJ_Face.h>

namespace Sx {
namespace Graphics {
namespace File {

/*
 * Each ObjectMesh holds one individual object contained within a single OBJ
 * file. This structure is intended to be used with the OBJ_File class.
 */
struct OBJ_Mesh {
	OBJ_Mesh(const String& name = "NoName") {
		this->name = name;
	}

	~OBJ_Mesh() {
		this->name.clear();
		this->vertices.clear();
		this->colors.clear();
		this->normals.clear();
		this->textureCoordinates.clear();
		this->faces.clear();
	}

	/*
	 * Holds the name of this object.
	 */
	String name;

	/*
	 * Geometric Structure of the Object.
	 */
	Util::VectorArray vertices;
	Util::VectorArray colors;
	Util::VectorArray normals;
	Util::VectorArray textureCoordinates;

	/*
	 * Holds all of the information about each face in the object.
	 * Groups, smoothing groups, and materials are associated with
	 * each face. For groups and smoothing groups, a face only contains
	 * an index. This index can be used to retrieve the associated
	 * group or material name from the groups or materials maps
	 * contained in the OBJ file definition.
	 */
	Util::ArrayList<OBJ_Face> faces;
	
};

}

}

}

#endif
